<?php

namespace LaraPress\Sliver;

use LaraPress\Config\LaraPressCms;
use LaraPress\Config\LaraPressTerm as ConfigLaraPressTerm;

class LaraPressTerm
{
    public static function get_cover($term)
    {
        $default_cover = LaraPressCms::get_option('category_cover');
        if ($default_cover) {
            $default_cover = $default_cover['url'];
        }
        $cover = ConfigLaraPressTerm::get_option($term, 'cover', ['url' => $default_cover]);
        if ($cover) {
            $cover = $cover['url'];
        }

        return $cover;
    }
}
